<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->
<!-- Function:  Calculate the HRM zones  -->
<!-- Required by: hrm1.htm -->
<!-- Copyright Brian Mackenzie 2004 -->

function hrcalculate()
{
  var age = document.hr.age.value;
  var rhr = document.hr.rhr.value;
  var ltz = document.hr.ltz.value;
  var utz = document.hr.utz.value;

  mhr = 217 - (age * 0.85);
  whr = mhr - rhr;
  trhr = rhr*1;
  lhr = (whr * (ltz/100))+trhr;
  uhr = (whr * (utz/100))+trhr;

  document.hr.lhr.value = Math.round(lhr);
  document.hr.uhr.value = Math.round(uhr);
  document.hr.mhr.value = Math.round(mhr);
  document.hr.whr.value = Math.round(whr);    
}

function valclear()
{
  document.hr.lhr.value = "";
  document.hr.uhr.value = "";
  document.hr.mhr.value = "";
  document.hr.whr.value = "";
}